<template>
    <div>
        <van-nav-bar title="评价" left-arrow @click-left="$router.go(-1)" />
        <van-tabs sticky>
            <van-tab :title="`全部(${allCount})`">
                <All :goodid="this.$store.state.goodsid"></All>
            </van-tab>
            <van-tab :title="`图片(${hasPicCount})`">
                <All :types="1" :goodid="this.$store.state.goodsid"></All>
            </van-tab>
        </van-tabs>
    </div>
</template>
<script>

import All from "../components/AllComment";
import { IComment } from "../api/request.js";
import commentcss from "../assets/css/comment.css";
export default {
    data() {
        return {
            allCount: 0,
            hasPicCount: 0,
            commentcss:{}
        };
    },
    mounted() {
        const paramss = { // 请求参数
            type: 0,
            valueId: this.$store.state.goodsid
        };
        IComment("/wx/comment/count", { params: paramss }).then(res => {
            this.hasPicCount = res.hasPicCount
            this.allCount = res.allCount
        });
    },
    components: {
        All
    }

};
</script>
<style :src="commentcss"></style>
